<?php
class image_resize extends PHPUnit_Framework_TestCase{

    public function setUp()
    {
		$this->product_model = app::get('tbdata')->model('product');
		$this->image_attach = app::get('image')->model('image_attach');
		$this->image_model = app::get('image')->model('image');
    }
    public function testGetcat(){

		$db = kernel::database();
		$model = app::get('image')->model('image');

        $where .= '1 and last_modified<=1315889846';
        $rs = $db->exec('select image_id from sdb_image_image where '.$where.' order by last_modified desc');
		$params['size'] = array('M','S');
        while($r=mysql_fetch_assoc($rs['rs'])){

            $model->rebuild($r['image_id'],$params['size'],false);

        }

	}
}
